const {validationResult } = require('express-validator');

const test01 = (req,res) => {
    const errors = validationResult(req)
    if (!errors.isEmpty()) {
        return res.status(422).json({ errors: errors.array() })
    }

    const name  = req.body.name
    const age   = req.body.age

    res.send({
        status : 200,
        msg : "success",
        data : {
            msg : "this is a test !",
            test : 1,
            name : name ,
            age : age ,
        }
    })
}

module.exports = test01